#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10;
int T;
ll ans;
int n;
int a[N];
int main(){
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    cin>>T;
    while(T--){
        ans=0;
        cin>>n;
        for(int i=1;i<=n;i++){
            cin>>a[i];
        }
        cout<<a[n/2]+a[n/3]+a[n/4]<<endl;
    }
    return 0;
}
